package com.study.demo04;

import com.study.demo02.UserService;
import com.study.demo02.UserServiceImpl;

public class Client {
    public static void main(String[] args) {
        UserServiceImpl service = new UserServiceImpl();
        //代理角色，使用生成
        ProxyInvocationHandler proxyInvocationHandler = new ProxyInvocationHandler();

        proxyInvocationHandler.setTarget(service);

        //动态生成代理类

        UserService proxy = (UserService) proxyInvocationHandler.getProxy();
        proxy.add();
        proxy.delete();
        proxy.update();
        proxy.select();


    }
}
